public class dp {

    public int fib (int n){
        if(n==2 ||n == 1){
            return 1;
        }
        int pre=1;
        int cur=1;
        int sum=0;
        for (int i=3;i<n; i++ ){
            sum=pre+cur;
            pre=cur;
            cur=sum;
        }
        return sum;
    }



    public static void main(String[] args) {
        dp dp = new dp();
        int ans=dp.fib(5);
        System.out.println(ans);
    }
}
